const eventEmiter = require('events')
// 创建发射器
const emitter = new eventEmiter()
// on和addEventListen是具有相同的作用的
emitter.on('click', (args) => {
  console.log('监听到1的click事件', args)
})
const listen = (args) => {
  console.log('监听到2的click事件', args)
}
emitter.on('click', listen)
const tapListen = args => {
  console.log('tap事件====')
}
emitter.on('tap', tapListen)
console.log(emitter.eventNames())